#include <system.h>

extern void *memcpy(void *dest, const void *src, size_t count) 
{
	const char *sp = (const char *)src;
	char *dp = (char *)dest;
	for (int i = 0; i < count; i++)
	{
		*dp = *sp;
		dp++;
		sp++;
	}

	return dest;
}

extern void *memset(void *dest, unsigned char val, size_t count)
{
	char *dp = (char *)dest;
	int i;
	for (i=0; i < count; i++)
	{
		*dp = val;
		dp++;
	}
	
	return dest;
}

extern unsigned short *memsetw(unsigned short *dest, unsigned short val, size_t count)
{
	int i;
	for (i=0; i < count; i++)
	{
		*dest = val;
		dest++;
	}

	return dest;
}
